package com.jiyun.feign;


import com.jiyun.entity.day06.Course;
import com.jiyun.vo.ResponseBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("day06-course")
public interface CourseFeign {
    @RequestMapping("/findByName")
    public ResponseBean findByName();

    @RequestMapping("/updateById")
    ResponseBean update(@RequestParam("id") Integer id,@RequestParam("likes") Integer likes);

    @RequestMapping("/findByUserMax")
    ResponseBean findByUserMax();

    /**
     * 查询最新课程
     * @return
     */
    @RequestMapping("/findUserNewTime")
    ResponseBean findUserNewTime();



    @RequestMapping("/dianZanPlus")
    ResponseBean dianZanPlus(@RequestParam("id") Integer id);

    /**
     * 查询所有课程
     * @param course
     * @return
     */
    @PostMapping("/findByAll")
    public ResponseBean findByAll(@RequestBody Course course);

    /**
     * 根据培训id查询课程
     * @param id
     * @return
     */
    @PostMapping("/findCourseByTraining")
    ResponseBean findCourseByTraining(@RequestParam("id") Integer id);
}
